﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace dsa
{
    public class MathUtils
    {
        private const int N = 100000 + 5;
        private static int tot = 0;
        private static int[] p = new int[N];
        private static bool[] prime = new bool[N];

        public static void init()
        {
            const int N = 1000 + 5;
            bool[] prime = new bool[N];
            for (int i = 2; i < N; i++) prime[i] = true;
            for (int i = 2; i * i < N; i++) {//判断改成i*i<N 
                if (prime[i]) {
                    for (int j = i * i; j < N; j += i) {//从i*i开始就可以了 
                        prime[j] = false;
                    }
                }
            }
            StringBuilder sb = new StringBuilder(3000);
            for(int i=0; i<prime.Length; i++) {
                if (prime[i]) sb.AppendFormat("{0}, ", i);
            }
            // 0.07, 0.79, 0.97
            //UnityEngine.Debug.LogError(sb.ToString());
        }
    }
}
